<!--<?php
print <<<EOT
-->

<script src="../css/edit.js"></script>

<!--Content Start-->
<table width="100%" border="0" align="center">
  <tr> 
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td>
      <table width="100%" border="0" align="left" cellpadding="3" cellspacing="3">
        <tr> 
          <td>
            
            <span id="msg_area" class="js_msg">$alert_message</span>
          
            <table border="0" cellspacing="1" cellpadding="1">
              <tr>
                <td width="50%">
                  <form name="form1" method="post" action="c_customer_add.php">
                  <table border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td><!--input type="text" class="text" name="name" size="20" value="Enter name ..." onFocus="form1.name.value=''"--></td>
                      <td><input name="image" type="image" onClick="form1.submit" src="../images/admin/bt_add.gif"></td>
			          <td><img src="../images/admin/shim.gif" width=30></td>
                    </tr>
                  </table>
                  </form>
                </td>
                <td align="right">
                <form name="form2" method="post" onsubmit="return validate_search(this, '$key')">
                  <table border="0" cellspacing="1" cellpadding="1">
                    <tr>
                      <td><input type="text" class="text" name="key" size="20" value="$key" onFocus="form2.key.value='';return false"><input type="hidden" name="action" value="search"></td>
			          <td><input name="image" type="image" src="../images/admin/bt_search.gif" onclick="form2.submit;"></td>
			          <td><input name="image" type="image" src="../images/admin/bt_listall.gif" onClick="location.href='c_customer_list.php';return false"></td>
                    </tr>
                  </table>
                  </form>
			    </td>
              </tr>
            </table>
            
            <span id="edit_area"></span>
            
            $page_show

            <table width="100%" border="0" cellspacing="1" cellpadding="1" class="tb">
              <tr class="tbheader">
                <td width="12%">Registe Time </td> 
                <td width="8%">Name</td>
                <td width="10%">Contact</td>
                <td width="8%">City</td>
                <td width="7%">Country</td>
			    <td width="8%">Email</td>
			    <td width="8%">Mailing</td>
		        <td width="8%">Username</td>
			    <td width="8%">Password</td>
			    <td width="6%">Status</td>
			    <td width="19%"></td>
              </tr>

<!--
EOT;
for($i=0; $i<count($out_ary); $i++){
    $register_date = $out_ary[$i]['regtime']==0?"":date("Y-m-d H:i:s", $out_ary[$i]['regtime']);
    
    $confirm_mail = $out_ary[$i]['status'] == 1 || $out_ary[$i]['status'] == 2 ? '<a href="c_confirm_email.php?uid=' . $out_ary[$i]['id'] . '"><img src="../images/admin/email.gif" width="26" border="0" alt="Send confirmation email"></a>' : '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
    $user_edit = '<a href="javascript:getAdminEdit(\'edit_area\', \'12\', \'' . $out_ary[$i]['id'] . '\')"><img src="../images/admin/bt_edit.gif" border="0" alt="Edit"></a>';
    
    if ($out_ary[$i]['status'] == 0) {
        $approve = '<a href="javascript:getAdminEdit(\'edit_area\', \'13\', \'' . $out_ary[$i]['id'] . '\')"><img src="../images/admin/add_stock.gif" width="26" border="0" alt="Approve"></a>';
        $user_edit = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
    } else {
        $approve = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
    }
    
print <<<EOT
-->
              
              <tr class="tbcontent1">
                <td>{$register_date}</td> 
                <td>{$out_ary[$i]['company']}</td>               
                <td>{$out_ary[$i]['firstname']} {$out_ary[$i]['lastname']}</td>
                <td>{$out_ary[$i]['city']}</td>
                <td>{$COUNTRY_ARY[$out_ary[$i]['countryid']]}</td>
                <td><font color=blue>{$out_ary[$i]['email']}</font></td>               
                <td>{$out_ary[$i]['address']}</td>
                <td>{$out_ary[$i]['username']}</td>

<!--
EOT;
if ($out_ary[$i]['status'] == 0) {
print <<<EOT
-->                

                <td>{$out_ary[$i]['password2']}&nbsp;&nbsp;&nbsp;&nbsp;</td>

<!--
EOT;
} else {
print <<<EOT
--> 
                <td>{$out_ary[$i]['password2']}&nbsp;&nbsp;&nbsp;&nbsp;</td>
                <!--td><span id="passedit_area_{$out_ary[$i]['id']}"><div onclick="getAdminEdit('passedit_area_{$out_ary[$i]['id']}', '31', '{$out_ary[$i]['id']}')">{$out_ary[$i]['password2']}&nbsp;&nbsp;&nbsp;&nbsp;</div></span></td-->
                
<!--
EOT;
} 
print <<<EOT
--> 
                
                <td align="center">{$USER_STATUS_ARY[$out_ary[$i]['status']]}</td>            
			    <td align=center bgcolor="ECECEC">{$approve} {$confirm_mail}
			    {$user_edit}
			    <a href="user.php?action=del&uid={$out_ary[$i]['id']}" onclick="return confirm('Delete {$out_ary[$i]['name']}?')"><img src="../images/admin/bt_delete.gif" border="0" Alt="Delete"></a>
			    <a href="user_record.php?uid={$out_ary[$i]['id']}" ><img src="../images/admin/bt_enquiry.gif" border="0" Alt="Tracking"></a>
				<a href="user_order_alert.php?uid={$out_ary[$i]['id']}" ><img src="../images/admin/bt_cart.gif" border="0" Alt="Tracking"></a>			    </td>
              </tr>

<!--
EOT;
} print <<<EOT
--> 
            </table>

            $page_show

          </td>
        </tr>
      </table>
      
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p></td>
  </tr>
</table>
<!--Content End-->

<!--
EOT;
if (isset($id) && $id>0) {
print <<<EOT
-->

<script>getAdminEdit('edit_area', '12', '{$id}');</script>             

<!--
EOT;
} print <<<EOT
--> 


<!--
EOT;
?>-->